module.exports = function($scope, $state, $stateParams, $modalInstance,$resource,$modal,code,toaster){ 
    console.log(code);
     $scope.info = {
        'ym_say' : '',
        'code' : code
    }
     $scope.ok = function(){
        console.log('ok');
        $resource('/api/as/mc/merplacedao/updatePlace', {}, {}). 
        save($scope.info,function(res){
            if(res.errcode != 0){
                toaster.error({title:"",body:res.errmsg});
                return;
            }
            $modalInstance.close();                                
            // $scope.info = res.data;
        })
    }
    $scope.cancel = function(){
        $modalInstance.close();                                        
    }
    // console.log('uuid' + uuid);
    if(code){
        $resource('/api/as/mc/merplacedao/getSKPlace', {}, {}). 
         save({'code' : code},function(res){
            if(res.errcode != 0){
                toaster.error({title:"",body:res.errmsg});
                return;
            }
            console.log('详情');
            console.log(res);
            $scope.info.ym_say = res.data.ym_say;
            
            // $scope.info = res.data;
        })
    }
   
   
    // var para = {
    //     business_time : $scope.tour_date,
    // };
    
    // $modalInstance.close();

   

    

   

    
}
